package cn.sh.tools.controller;

import cn.sh.tools.util.PdfUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "PDF")
@RestController
@RequestMapping(value = "/pdf")
public class PdfController {

    @ApiOperation("将pdf转为图片")
    @RequestMapping(method = RequestMethod.POST, value = "/pdfToImage")
    public String pdfToImage(@RequestParam(value = "pdfPath") String pdfPath,
                             @RequestParam(value = "imgSuffix") String imgSuffix) {
        return PdfUtils.pdfToImage(pdfPath, imgSuffix);
    }

}
